/**
 * 
 */
package ar.com.mun.services.impl;

import java.util.Collection;

import org.apache.commons.collections15.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import ar.com.mun.beans.Municipalidad;
import ar.com.mun.daos.MunicipalidadDAO;
import ar.com.mun.services.MunicipalidadService;

import com.angel.architecture.services.impl.GenericServiceImpl;
import com.angel.architecture.transformers.PersistentObjecToTTransformer;

/**
 * @author Guillermo Salazar
 *
 */
@Service
public class MunicipalidadServiceImpl extends GenericServiceImpl implements MunicipalidadService{

	@Autowired
	private MunicipalidadDAO municipalidadDAO;
	
	@Override
	public Collection<Object> findAll(){
		Collection<Municipalidad> a = this.getMunicipalidadDAO().findAll();
		Collection<Object> o = CollectionUtils.transformedCollection(a, new PersistentObjecToTTransformer<Object>());
		return o;
	}

	/**
	 * @return the municipalidadDAO
	 */
	public MunicipalidadDAO getMunicipalidadDAO() {
		return municipalidadDAO;
	}

	/**
	 * @param municipalidadDAO the municipalidadDAO to set
	 */
	public void setMunicipalidadDAO(MunicipalidadDAO municipalidadDAO) {
		this.municipalidadDAO = municipalidadDAO;
	}	
}
